/**
 * @file       godemool/xmlprinter.h
 * @brief      XML printer.
 * @author     ben "boin" bonoeil
 * @date       2015-02
 */

/* Copyright (c) 2007-2015, ben "boin" bonoeil */

#ifndef GODEMOOL_XMLPRINTER_H
#define GODEMOOL_XMLPRINTER_H

#include "godemool/iprinter.h"
#include <tinyxml2.h>

namespace boin { class XmlPrinter; }

class boin::XmlPrinter : public boin::IPrinter, public tinyxml2::XMLPrinter
{
protected:
  std::ostream & os;

protected:
  void Flush();
  void PrintSpace( int depth ); // Override

public:
  XmlPrinter(std::ostream & stream);

  virtual void Open(const std::string & uri, const Hl2Demo::Header & hd);
  virtual void Close();
  virtual ~XmlPrinter();

  virtual void BegElt(const char * name);
  virtual void EndElt(const char * name);
  virtual void Attr(const char * name, const char * val);
  virtual void Str(const char * data);
  virtual void Data(const WalkData & data);
};

#endif

/* Local Variables:  */
/* mode: c++         */
/* End:              */
